﻿--[[
   @brief    game library desc
   @author   phenixwu
   @version  1.0
   @date     2015-03-13
--]]

game_library_desc = {
    module_name = 'game_library',
    events = {
        {
            c_event = {
                {
                    id  = ierd_tgp.login_mgr.LOGIN_ON_LOGIN_SUCCESS,
                    callback = 'game_library_control.query_game_library_common_info'
                },
                {
                    id  = ierd_tgp.game_library.K_QUERY_GAMESTAT_RESULT,
                    callback = 'game_library_control.update_gamestat_info'
                },
                {
                    id  = ierd_tgp.game_library.UPDATE_GAME_STATE,
                    callback = 'game_library_control.update_game_state'
                },
                {
                    id = ierd_tgp.tgp_plugin.PLUGINMGR_ON_TGP_OPEN_LINK,
                    callback = 'game_library_control.cpp_open_link'
                },
                {
                    id = ierd_tgp.game_library.QUERY_PLAY_GAME_LIST_RSP,
                    callback = 'game_library_control.query_play_game_list_rsp'
                },
                {
                    id = ierd_tgp.game_library.QUERY_GAME_ATTENT_LIST_RSP,
                    callback = 'game_library_control.query_game_attent_list_rsp'
                },
                {
                    id = ierd_tgp.game_library.K_BEFORE_UPDATE_GAME,
                    callback = 'game_library_control.before_update_game'
                },
                {
                    id = ierd_tgp.game_library.ADD_ASSIST_SILENTLY,
                    callback = 'game_library_control.add_assist_silently'
                },
                --[[ lcu remove
                {
                    id = ierd_tgp.game_library.UPDATE_LCU_STATE,
                    callback = 'game_library_control.update_lcu_state'
                },
                ]]
                {
                    id = ierd_tgp.game_library.GET_RAIL_GAME_RELEASE_STATUS,
                    callback = 'game_library_control.on_get_mmog_game_release_status'
                },
                {
                    id = ierd_tgp.tgp_plugin.PUSH_GIFT_INFO,
                    callback = "game_library_control.on_push_gift_info"
                },
            },
            lua_event = {
                {
                    id = game_library_event.LOAD_SUCCESS,
                    callback = 'game_library_control.reserved_fun'
                },
                {
                    id = game_library_event.GET_USER_LEVEL,
                    callback = 'game_library_control.get_user_level'
                },
                {
                    id = game_library_event.GAME_ACTIVATE_RESULT,
                    callback = 'game_library_control.send_game_activate_result'
                },
                {
                    id = game_library_event.REQUEST_GAME_INSTALL,
                    callback = 'game_library_control.request_game_install'
                },
                {
                    id = open_link_event.OPEN_LINK,
                    callback = 'game_library_control.open_link'
                },
                {
                    id = game_library_event.GET_GAME_STATES,
                    callback = "game_library_control.handle_get_game_states"
                },
                {
                    id = main_web_event.ON_JS_CALLBACK_TO_GAME_LIBRARY,
                    callback = "game_library_control.handle_js_callback"
                },
            },
            reg_service = {
                {
                    id = 'service_game_library_get_game_detial_info',
                    callback = 'game_library_control.get_game_detial_info_service'
                },
                {
                    id = 'service_game_library_is_game_in_list',
                    callback = 'game_library_control.is_game_in_game_list'
                },
                {
                    id = 'i_service_game_library_auto_download',
                    callback = 'game_library_control.open_detail_page_or_start_download'
                },
                {
                    id = 'Svr_RedownlaodGameAfterUninstalled',
                    callback = 'game_library_control.re_download_after_uninstall_broken_game'
                },
                {
                    id = 'Svr_gl_get_game_list_info',
                    callback = 'game_library_control.on_get_game_list_info'
                },
                {
                    id = 'Svr_RemoveNoAuthGameFromList',
                    callback = 'game_library_control.remove_no_auth_game_from_list'
                },
            },
            listen_broadcast = {
                {
                    id = "i_broadcast_open_link_finish",
                    callback = "game_library_control.handle_auto_download"
                }
            },
            lua_file = 'game_library\\control.lua'
        }
    }
};

desc_mgr.add(game_library_desc);